﻿using System;
using Assist;
using Autodesk.Revit.DB;
using YJKRoomInspection.Model;

namespace YJKRoomInspection.FireAreOutLineAppend
{
	public class Def_Sel
	{
		public bool IsSingleDoor()
		{
			if (this.m_kType != EleType.eDoor)
			{
				return false;
			}
			int nWide = (int)AssistFunc.feetToMM((this.m_element as FamilyInstance).Symbol.get_Parameter(BuiltInParameter.CASEWORK_WIDTH).AsDouble());
			return this.IsSingleDoor(nWide);
		}

		private bool IsSingleDoor(int nWide)
		{
			return nWide <= 1000;
		}

		public string GetNewSymbolName()
		{
			if (this.m_kType == EleType.eWall)
			{
				return "";
			}
			string result = "";
			FamilyInstance familyInstance = this.m_element as FamilyInstance;
			Parameter parameter = familyInstance.Symbol.get_Parameter(BuiltInParameter.CASEWORK_WIDTH);
			Parameter parameter2 = familyInstance.Symbol.get_Parameter(BuiltInParameter.FAMILY_HEIGHT_PARAM);
			int num = (int)(AssistFunc.feetToMM(parameter.AsDouble()) / 100.0);
			int num2 = (int)(AssistFunc.feetToMM(parameter2.AsDouble()) / 100.0);
			switch (this.m_kType)
			{
			case EleType.eDoor:
				result = "FM" + num.ToString("D2") + num2.ToString("D2") + " 甲";
				break;
			case EleType.eWindow:
				result = "FC" + num.ToString("D2") + num2.ToString("D2") + " 甲";
				break;
			case EleType.eDoorRolling:
				result = "FJLM" + num.ToString("D2") + num2.ToString("D2") + " 特";
				break;
			}
			return result;
		}

		public Element m_element;

		public string m_strEleName;

		public EleType m_kType;

		public ElementId m_viewId;

		public string m_strViewName;

		public bool m_bIsLinkEle;

		public RevitLinkInstance m_RevitLinkInstance;
	}
}
